package extend.pattern.proxy;

import java.lang.reflect.Method;

import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;
/* 
 * 实现了方法拦截器接口 
 */  
public class MyMethodInterceptor implements MethodInterceptor {

	@Override
	public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
		System.out.println("cglib代理：当前执行方法：" + method.toString() + "---------start");
		proxy.invokeSuper(obj, args);
		System.out.println("cglib代理：当前执行方法：" + method.toString() + "---------end");
		return null;
	}

}
